
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import com.boco.utils.ReadLine;
  
public class HttpUserUtil implements Runnable {  
	private static final Log log = LogFactory.getLog(HttpUserUtil.class);
    public static void main(String[] args) {
    	(new Thread(new HttpUserUtil())).start();  
	}
		@Override
		public void run() {
			// TODO 根据文件属性值来调用不同的插入表。
			List<String> table = new ArrayList<String>();
			table = ReadLine.readFileByLines("D:\\workspaceHigh\\test\\src\\com\\boco\\table\\TableName");
			for (int i=0;i<table.size();i++){
				System.out.println(table.get(i));
			//通过java反射来调用插入类。
				String className="Insert"+table.get(i)+"DataAction";
				try {
					Class<?> clazz = Class.forName("com.boco.action."+className);
					  Method method;
					  method = clazz.getMethod("insertData");
				      method.invoke(clazz.newInstance());
				} catch (ClassNotFoundException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				} catch (NoSuchMethodException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				} catch (SecurityException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				} catch (IllegalAccessException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				} catch (IllegalArgumentException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				} catch (InvocationTargetException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				} catch (InstantiationException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
		}
    	
}

